#ifndef INCLUDE_COLOR_H
#define INCLUDE_COLOR_H

#include <pi_lib.h>

typedef struct  
{
	byte rgba[4];
}T3dColor;

static void color_set(T3dColor *color, byte r, byte g, byte b, byte a)
{
	color->rgba[0] = r;
	color->rgba[1] = g;
	color->rgba[2] = b;
	color->rgba[3] = a;
}

static PiBool color_is_equal(const T3dColor *c1, const T3dColor *c2)
{
	return *(int *)c1->rgba == *(int *)c2->rgba;
}

static void color_copy(T3dColor *dst, const T3dColor *src)
{
	pi_memcpy(dst, src, sizeof(T3dColor));
}

static void color_get_float(T3dColor *color, float c[4])
{
	c[0] = color->rgba[0] / 255.0f;
	c[1] = color->rgba[1] / 255.0f;
	c[2] = color->rgba[2] / 255.0f;
	c[3] = color->rgba[3] / 255.0f;
}

#endif /* INCLUDE_COLOR_H */